package com.bsi.rd.framework.auth.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Configuration;

/*
 * Author: liusongs
 * Date: 2019/10/18 9:45
 * Content: 配置oauth2 token与refreshToken的有效时长
 */
@Configuration
@ConfigurationProperties(prefix = "oauth.validity")
@RefreshScope
public class TokenValiditySecondsConfig {
    private int access_token = 2 * 60 * 60; // 默认2个小时

    private int refresh_token = 12 * 60 * 60; // 默认12个小时

    public int getAccess_token() {
        return access_token;
    }

    public void setAccess_token(int access_token) {
        this.access_token = access_token;
    }

    public int getRefresh_token() {
        return refresh_token;
    }

    public void setRefresh_token(int refresh_token) {
        this.refresh_token = refresh_token;
    }
}
